﻿namespace TestingConcurrencyBenchmark.Problems.CigaretteSmokers
{
    internal class CigaretteSmokerWithDeadlock : AbstractCigaretteSmoker
    {
        public override void PushTobacco()
        {
        }

        public override void PushPaper()
        {
        }

        public override void PushMatch()
        {
        }

        public override void ConsumeResourcesAsSmokerWithMatch()
        {
            CreatedPaper.WaitOne();
            CreatedTobacco.WaitOne();
            AgentLock.Release();
        }

        public override void ConsumeResourcesAsSmokerWithTobacco()
        {
            CreatedPaper.WaitOne();
            CreatedMatch.WaitOne();
            AgentLock.Release();
        }

        public override void ConsumeResourcesAsSmokerWithPaper()
        {
            CreatedMatch.WaitOne();
            CreatedTobacco.WaitOne();
            AgentLock.Release();
        }
    }
}